package edu.sctu.practice.class01.zhangwang.day2015_10_08.text02;

/**
 * Created by Z_W on 2015/10/8.
 */
public class Vehicle {
    public int speed;
    public float size;

    public Vehicle(int speed, float size) {
        this.speed = speed;
        this.size = size;
    }

    public void move() {
        System.out.println("车的体积为：" + speed + "。正在以速度为：" + size + "进行移动。");
    }

    public void setSpeed(int speed) {
        this.speed = speed;
        System.out.println("现在速度为：" + speed);
    }

    public void speedUp() {
        speed += 5;
        System.out.println("加速后,现在速度为：" + speed);
    }

    public void speedDown() {
        speed -= 10;
        System.out.println("减速后，现在速度为：" + speed);
    }
}
